package com.wellwan.cloud.feignclient;

import com.wellwan.cloud.entity.User;
import com.wellwan.cloud.fallbackfactoty.FeignClientFallbackFactory;
import feign.Headers;
import feign.Param;
import feign.RequestLine;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * Copyright (C),微动天下
 * FileName: UserFeignClient
 * Author:   maokai
 * Date:     2020/2/24 11:35
 * Description:
 */
//@FeignClient(name="microservice-provider-user-with-auth",fallbackFactory = FeignClientFallbackFactory.class
//)
public interface UserFeignClient {
    @RequestMapping(value = "/{id}",method = RequestMethod.GET)
    User findById(@PathVariable("id") Long id);

    /**
     * 文件上传
     * @param file
     * @return
     */
    @RequestMapping(value = "upload",method = RequestMethod.POST,consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    String handleFileUpload(@RequestPart(value = "file") MultipartFile file);
}
